import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '../views/Login/AuthView.vue'
import index from '../views/IndexView.vue'
import LoginC from '../components/login.vue'
import RegisterC from '../components/register.vue'
import managerViewVue from '@/views/manager/managerView.vue'
import ShopInfoView from '@/views/manager/shop/ShopInfoView.vue'
import GoodsInfoView from '@/views/manager/goods/GoodsInfoView.vue'
import FindViewVue from '@/views/manager/find/FindView.vue'
import ManagerIndexView from '@/views/manager/ManagerIndexView.vue'



const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path: '/auth',
      component: LoginView,
      children: [
        {
          path: 'login',
          component: LoginC
        },
        {
          path: 'register',
          component: RegisterC
        }
      ]
    },
    {
      path: '/manager',
      component: managerViewVue,
      children: [{
        path: '/',
        component: ShopInfoView
      },
      {
        path: 'index',
        component: import('@/views/manager/ManagerIndexView.vue')
      },
      {
        path: 'shop',
        component: GoodsInfoView
      }, {
        path: 'order',
        component: () => import('@/views/manager/order/OrderView.vue')
      }, {
        path: 'menu',
        component: () => import('@/views/manager/menu/MenuView.vue')
      }, {
        path: 'apply',
        component: () => import('@/views/manager/apply/ApplyView.vue')
      },
      ]
    }
  ]
})

export default router
